package com.ztstkj.lzservices.extension

object StringExtension {
    fun String.str2ByteArray(): ByteArray {
        val souce = this.replace(" ", "")
        //require(souce.length % 2 == 0) { "The input string must have an even length" }
        return souce.chunked(2).map { it.toInt(16).toByte() }.toByteArray()
    }

    fun String.dump(prefix: String? = "") {
        System.err.println("${prefix ?: "输出"}：$this")
    }
}